﻿/** 
 * Copyright / Licence
 * <p>
 * You are free:
 * <li>to Share — to copy, distribute and transmit the work
 * <li>to Remix — to adapt the work
 * </p>
 * <p>
 * Under the following conditions:
 * <li>Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
 * <li>Noncommercial — You may not use this work for commercial purposes.
 * <li>Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
 * </p>
 * <p>
 * More information can be found here:
 * <br/>
 * http://creativecommons.org/licenses/by-nc-sa/3.0/
 * </p>
 * <p>
 * Please contact Manfred Weber [manfred.weber@gmail.com] if you require a commercial licence
 * </p>
 */
 package org.dschini.data.ui.maps {
	
	import org.dschini.utils.*;
	import org.dschini.data.*;
	import org.dschini.data.ui.maps.*;
	import org.dschini.data.ui.maps.world.*;
	
	public class WorldMapData extends MapData
	{
		public var africaMapData:MapData;
		public var asiaMapData:MapData;
		public var europeMapData:MapData;
		public var northAmericaMapData:MapData;
		public var southAmericaMapData:MapData;
		public var oceaniaMapData:MapData;
	
		public function WorldMapData():void
		{
			_title = "<undefined>";
			locationData = new ExtendedArray();
			backgroundVisible = false;
			countryLinesVisible = false;
			shapeVisible = true;
			
			africaMapData = new AfricaMapData();
			asiaMapData = new AsiaMapData();
			europeMapData = new EuropeMapData();
			northAmericaMapData = new NorthAmericaMapData();
			southAmericaMapData = new SouthAmericaMapData();
			oceaniaMapData = new OceaniaMapData();
			
			continents = [
				africaMapData,
				asiaMapData,
				europeMapData,
				northAmericaMapData,
				southAmericaMapData,
				oceaniaMapData
			]
		}
		
		override public function set lang( lang:String ):void
		{
			_lang = lang;
			switch( _lang ){
				case "en":
					_title = "World";
					break;
				case "de":
					_title = "Welt";
					break;
			}
			var i:int;
			for(i=0; i<continents.length; i++){
				MapData(continents[i]).lang = lang;
			}
			for(i=0; i<locationData.length; i++){
				MapLocationData(locationData[i]).lang = lang;
			}
		}
	}
}
